<!--
 * @Descripttion: 
 * @version: 
 * @Author: 
 * @Date: 2019-10-25 10:17:04
 -->
<template>
  <el-form-item :rules="item.rules" :label="item.label" :prop="item.key">
    <el-input
      v-if="item.type==='input'"
      v-bind="$attrs"
      v-on="$listeners"
      :type="item.subtype"
      :placeholder="item.placeholder"
      :disabled="item.disable"
      :readonly="item.readonly"
      :autosize="item.autosize"
    ></el-input>
    <el-select
      v-else-if="item.type==='select'"
      v-bind="$attrs"
      v-on="$listeners"
      :multiple="item.multiple"
      :disabled="item.disabled"
      :multiple-limit="item.multipleLimit"
    >
      <el-option
        v-for="oItem in item.options"
        :key="oItem.value"
        :label="oItem.label"
        :value="oItem.value"
        :disabled="oItem.disabled"
      ></el-option>
    </el-select>
    <treeselect
      v-else-if="item.type==='tree'"
      v-bind="$attrs"
      v-on="$listeners"
      :multiple="true"
      :options="item.options"
      :placeholder="item.placeholder"
    />
  </el-form-item>
</template>

<script>
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";

export default {
  components: {
    Treeselect
  },
  data() {
    return {};
  },
  props: {
    item: {
      type: Object,
      required: true
    }
  }
};
</script>